package com.lagou.flashsale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.data.redis.core.RedisTemplate;

@SpringBootApplication
public class FlashsalePortalApplication {

	@Autowired
	private RedisTemplate<String, Integer> template;

	public static void main(String[] args) {
		SpringApplication.run(FlashsalePortalApplication.class, args);
	}

	@Bean
	public CommandLineRunner runner() {
		return args -> {
			template.opsForValue().set("goods_count", 5);
		};
	}

}
